import * as echarts from "echarts";
import world from "../../public/map.json";
export const options1 = () => {
  const option = {
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "line",
        lineStyle: {
          color: "rgba(144, 255, 255)",
        },
      },

      backgroundColor: "rgba(10, 24, 48, 0.5)",
      borderColor: "rgba(75, 253, 238, 0.4)",
      textStyle: {
        color: "#CFE3FC",
      },
      borderWidth: 0.1,
    },
    grid: {
      top: "15%",
      right: "2%",
      left: "10%",
      bottom: "12%",
    },
    xAxis: [
      {
        name: "月份",
        type: "category",
        data: ["一月", "二月", "三月", "四月", "五月"],
        axisLine: {
          lineStyle: {
            width: 0.1,
            color: "#3c4472",
          },
        },
        axisLabel: {
          margin: 10,
          color: "#e2e9ff",
          textStyle: {
            fontSize: 12,
          },
        },
        axisTick: {
          show: false,
        },
      },
    ],
    yAxis: [
      {
        axisLabel: {
          formatter: "{value}",
          color: "#e2e9ff",
        },
        axisTick: {
          show: false,
        },
        axisLine: {
          show: true,
          lineStyle: {
            width: 0.8,
            color: "#3c4472",
          },
        },
        splitLine: {
          lineStyle: {
            color: "rgba(255,255,255,0.12)",
          },
        },
      },
    ],
    series: [
      {
        type: "bar",
        data: [2000, 1520, 1850, 3400, 2756],
        barWidth: "23%",

        itemStyle: {
          normal: {
            borderRadius: [5, 5, 5, 5],
            color: new echarts.graphic.LinearGradient(
              0,
              0,
              0,
              1,
              [
                {
                  offset: 0,
                  color: "rgba(0,244,255,1)", // 0% 处的颜色
                },
                {
                  offset: 1,
                  color: "rgba(0,77,167,1)", // 100% 处的颜色
                },
              ],
              false
            ),
            shadowColor: "rgba(0,160,221,1)",
            shadowBlur: 4,
          },
        },
        label: {
          normal: {
            show: true,
            lineHeight: 10,
            formatter: "{c}",
            position: "top",
            textStyle: {
              color: "#00D6F9",
              fontSize: 12,
            },
          },
        },
      },
    ],
  };
  return option;
};
export const options2 = () => {
  var xData = [
    "0点",
    "1点",
    "2点",
    "3点",
    "4点",
    "5点",
    "6点",
    "7点",
    "8点",
    "9点",
    "10点",
    "11点",
    "12点",
    "13点",
    "14点",
  ];
  const option = {
    legend: {
      show: true,
      textStyle: {
        color: "#fff",
      },
    },
    grid: {
      left: "5%",
      right: "10%",
      top: "25%",
      bottom: "15%",
      containLabel: true,
    },
    tooltip: {
      show: true,
      trigger: "axis",
    },
    xAxis: [
      {
        type: "category",
        axisLine: {
          show: true,
          lineStyle: {
            width: 0.5,
            color: "#3c4472",
          },
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          color: "#8BC4F2",
          margin: 6,
        },
        splitLine: {
          show: false,
        },
        boundaryGap: ["5%", "5%"],
        data: xData,
      },
    ],
    yAxis: [
      {
        type: "value",
        axisLabel: {
          color: "#8BC4F2",
          margin: 6,
        },
        splitLine: {
          lineStyle: {
            width: 1,
            color: "#3c4472",
            type: "dashed",
          },
        },
      },
    ],
    series: [
      {
        name: "太平洋",
        type: "line",
        stack: "总量",
        symbolSize: 6,
        itemStyle: {
          color: "#55EFF1",
          borderColor: "#55EFF1",
          borderWidth: 2,
        },
        data: [
          120, 132, 101, 134, 90, 432, 421, 234, 230, 210, 182, 191, 234, 290,
          330,
        ],
      },
      {
        name: "大洋洲",
        type: "line",
        stack: "总量",
        symbolSize: 6,
        itemStyle: {
          color: "#55EFF1",
          borderColor: "#55EFF1",
          borderWidth: 2,
        },
        data: [
          120, 132, 101, 134, 90, 432, 421, 234, 230, 210, 182, 191, 234, 290,
          330,
        ],
      },
      {
        name: "欧洲",
        type: "line",
        stack: "总量",
        symbolSize: 6,
        itemStyle: {
          color: "#55EFF1",
          borderColor: "#55EFF1",
          borderWidth: 2,
        },
        data: [
          120, 132, 101, 134, 90, 432, 421, 234, 230, 210, 182, 191, 234, 290,
          330,
        ],
      },
      {
        name: "其他",
        type: "line",
        stack: "总量",
        symbolSize: 6,
        itemStyle: {
          color: "#55EFF1",
          borderColor: "#55EFF1",
          borderWidth: 2,
        },
        data: [
          120, 132, 101, 134, 90, 432, 421, 234, 230, 210, 182, 191, 234, 290,
          330,
        ],
      },
    ],
  };
  return option;
};
export const options3 = () => {
  // Generate data
  let seriesData = [
    {
      value: 15337.306,
      name: "SMA-13",
      radio: 87.7,
    },
    {
      value: 546.168,
      name: "AK-13",
      radio: 3.12,
    },
    {
      value: 522.817,
      name: "AC-13",
      radio: 2.99,
    },
    {
      value: 185.99,
      name: "水泥混凝土",
      radio: 1.06,
    },
    {
      value: 185.99,
      name: "水泥混凝土",
      radio: 1.06,
    },
    {
      value: 185.99,
      name: "水泥混凝土",
      radio: 1.06,
    },
  ];

  const option = {
    tooltip: {
      confine: true,
      trigger: "item",
      axisPointer: {
        type: "line",
        crossStyle: {
          color: "#999",
        },
      },
      backgroundColor: "rgba(4,46,85,0.8)",
      borderColor: "#008dfd",
      textStyle: {
        color: "#fff",
        fontFamily: "Arial",
        fontSize: 12,
      },
      lineStyle: {
        color: "#b3b9b7",
      },
    },
    legend: {
      bottom: "5%",

      textStyle: {
        color: "#fff",
      },
    },
    series: [
      {
        name: "",
        type: "pie",
        radius: ["45%", "65%"],
        center: ["50%", "40%"],
        avoidLabelOverlap: false,
        itemStyle: {
          borderColor: "rgb(4,24,45,0)",
          borderWidth: 11,
          normal: {},
        },
        label: {
          show: false,
          position: "inner",
          fontSize: 12,
        },
        labelLine: {
          show: false,
        },
        data: seriesData,
      },
    ],
  };
  return option;
};
export const options4 = () => {
  var data = [
    { code: "德国", stock: "aaa", fundPost: "2230" },
    { code: "意大利", stock: "bbb", fundPost: "1340" },
    { code: "法国", stock: "ccc", fundPost: "1678" },
    { code: "西班牙", stock: "ddd", fundPost: "1890" },
    { code: "美国", stock: "eee", fundPost: "1753" },
  ];
  function contains(arr, dst) {
    var i = arr.length;
    while ((i -= 1)) {
      if (arr[i] == dst) {
        return i;
      }
    }
    return false;
  }

  var attackSourcesColor = [
    new echarts.graphic.LinearGradient(0, 1, 1, 1, [
      { offset: 0, color: "#EB3B5A" },
      { offset: 1, color: "#FE9C5A" },
    ]),
    new echarts.graphic.LinearGradient(0, 1, 1, 1, [
      { offset: 0, color: "#FA8231" },
      { offset: 1, color: "#FFD14C" },
    ]),
    new echarts.graphic.LinearGradient(0, 1, 1, 1, [
      { offset: 0, color: "#F7B731" },
      { offset: 1, color: "#FFEE96" },
    ]),
    new echarts.graphic.LinearGradient(0, 1, 1, 1, [
      { offset: 0, color: "#395CFE" },
      { offset: 1, color: "#2EC7CF" },
    ]),
  ];
  var attackSourcesColor1 = [
    "#EB3B5A",
    "#FA8231",
    "#F7B731",
    "#3860FC",
    "#1089E7",
    "#F57474",
    "#56D0E3",
    "#1089E7",
    "#F57474",
    "#1089E7",
    "#F57474",
    "#F57474",
  ];
  var attaData = [];
  var attaName = [];
  var topName = [];
  data.forEach((it, index) => {
    attaData[index] = parseFloat(it.fundPost).toFixed(2);
    attaName[index] = it.stock;
    topName[index] = `${it.code} `;
  });
  var salvProMax = []; //背景按最大值
  for (let i = 0; i < attaData.length; i++) {
    salvProMax.push(attaData[0]);
  }
  function attackSourcesDataFmt(sData) {
    var sss = [];
    sData.forEach(function (item, i) {
      let itemStyle = {
        color: i > 3 ? attackSourcesColor[3] : attackSourcesColor[i],
      };
      sss.push({
        value: item,
        itemStyle: itemStyle,
      });
    });
    return sss;
  }

  var option = {
    tooltip: {
      show: false,
      backgroundColor: "rgba(3,169,244, 0.5)", //背景颜色（此时为默认色）
      textStyle: {
        fontSize: 16,
      },
    },
    color: ["#F7B731"],
    legend: {
      pageIconSize: [12, 12],
      itemWidth: 20,
      itemHeight: 10,
      textStyle: {
        //图例文字的样式
        fontSize: 10,
        color: "#fff",
      },
      selectedMode: false,
      // data: ["个人所得(亿元)"],
    },
    grid: {
      left: "0%",
      right: "1%",
      width: "90%",
      bottom: "2%",
      top: "3%",
      containLabel: true,
    },
    xAxis: {
      type: "value",

      splitLine: {
        show: false,
      },
      axisLabel: {
        show: false,
      },
      axisTick: {
        show: false,
      },
      axisLine: {
        show: false,
      },
    },
    yAxis: [
      {
        type: "category",
        inverse: true,
        axisLine: {
          show: false,
        },
        axisTick: {
          show: false,
        },
        axisPointer: {
          label: {
            show: true,
            //margin: 30
          },
        },
        pdaaing: [5, 0, 0, 0],
        postion: "right",
        data: attaName,
        axisLabel: {
          margin: 30,
          fontSize: 10,
          align: "left",
          padding: [2, 0, 0, 0],
          color: "#000",
          rich: {
            nt1: {
              color: "#fff",
              backgroundColor: attackSourcesColor1[0],
              width: 13,
              height: 13,
              fontSize: 10,
              align: "center",
              borderRadius: 100,
              lineHeight: "5",
              padding: [0, 1, 2, 1],
              // padding:[0,0,2,0],
            },
            nt2: {
              color: "#fff",
              backgroundColor: attackSourcesColor1[1],
              width: 13,
              height: 13,
              fontSize: 10,
              align: "center",
              lineHeight: "13",
              borderRadius: 100,
              padding: [0, 1, 2, 1],
            },
            nt3: {
              color: "#fff",
              backgroundColor: attackSourcesColor1[2],
              width: 13,
              height: 13,
              fontSize: 10,
              align: "center",
              borderRadius: 100,
              padding: [0, 1, 2, 1],
            },
            nt: {
              color: "#fff",
              backgroundColor: attackSourcesColor1[3],
              width: 13,
              height: 13,
              fontSize: 10,
              align: "center",
              lineHeight: 3,
              borderRadius: 100,
              padding: [0, 1, 2, 1],
              lineHeight: 5,
            },
          },
          formatter: function (value, index) {
            index = contains(attaName, value) + 1;
            if (index - 1 < 3) {
              return ["{nt" + index + "|" + index + "}"].join("\n");
            } else {
              return ["{nt|" + index + "}"].join("\n");
            }
          },
        },
      },
      {
        type: "category",
        inverse: true,
        axisTick: "none",
        axisLine: "none",
        show: true,
        axisLabel: {
          textStyle: {
            color: "#fff",
            fontSize: "10",
          },
        },
        data: attackSourcesDataFmt(attaName),
      },
      {
        //名称
        type: "category",
        offset: -10,
        position: "left",
        axisLabel: {
          color: `#fff`,
          fontSize: 10,
        },
        axisLine: {
          show: false,
        },
        inverse: false,
        axisTick: {
          show: false,
        },
        axisLabel: {
          interval: 0,
          color: ["#fff"],
          align: "left",
          verticalAlign: "bottom",
          lineHeight: 32,
          fontSize: 10,
        },
        data: topName,
      },
    ],
    series: [
      {
        zlevel: 1,
        // name: "个人所得(亿元)",
        type: "bar",
        barWidth: "15px",
        animationDuration: 1500,
        data: attackSourcesDataFmt(attaData),
        align: "center",
        itemStyle: {
          normal: {
            barBorderRadius: 10,
          },
        },
        label: {
          show: true,
          fontSize: 10,
          color: "#fff",
          textBorderWidth: 2,
          padding: [2, 0, 0, 0],
        },
      },
      {
        // name: "个人所得(亿元)",
        type: "bar",
        barWidth: 15,
        barGap: "-100%",
        margin: "20",
        data: salvProMax,
        textStyle: {
          //图例文字的样式
          fontSize: 10,
          color: "#fff",
        },
        itemStyle: {
          normal: {
            color: "#05325F",
            //width:"100%",
            fontSize: 10,
            barBorderRadius: 30,
          },
        },
      },
    ],
  };
  return option;
};
export const options5 = () => {
  let dataList = [
    {
      name: "12月",
      value: "7",
    },
    {
      name: "1月",
      value: "6",
    },
    {
      name: "2月",
      value: "6.5",
    },
    {
      name: "3月",
      value: "5.3",
    },
    {
      name: "4月",
      value: "6",
    },
    {
      name: "5月",
      value: "5.2",
    },
    {
      name: "6月",
      value: "5.8",
    },
  ];

  const option = {
    legend: {
      legend: true,
      textStyle: {
        color: "#fff",
      },
    },
    tooltip: {
      trigger: "axis",
      backgroundColor: "rgba(17,95,182,0.5)",
      textStyle: {
        color: "#fff",
      },
      triggerOn: "mousemove",
      showContent: true,
    },
    title: {
      left: 26,
      top: 26,
      textStyle: {
        color: "#FFFFFF",
        fontSize: 15,
        fontWeight: 50000,
        fontFamily: "PingFang SC",
      },
    },
    grid: {
      width: "90%",
      left: "4%",
      bottom: "5%",
      top: "30%",
      containLabel: true,
    },
    dataZoom: [
      {
        type: "inside",
        start: 0,
        end: dataList.length > 15 ? 35 : 100,
      },
    ],
    xAxis: {
      boundaryGap: false,
      axisLine: {
        lineStyle: {
          color: "#397cbc",
        },
      },
      splitLine: {
        show: false,
      },
      axisTick: {
        show: false,
      },
      //轴线上的字
      axisLabel: {
        show: true,
        textStyle: {
          color: "rgba(255,255,255,0.8)",
          fontSize: "14",
        },
      },
      data: ["12月", "1月", "2月", "3月", "4月", "5月", "6月"],
    },
    yAxis: [
      {
        name: "(元/斤)",
        nameTextStyle: {
          color: "rgba(255,255,255,0.8)",
        },
        type: "value",
        splitNumber: 4,
        axisTick: {
          show: false,
        },
        //轴线上的字
        axisLabel: {
          show: true,
          textStyle: {
            fontSize: "14",
            color: "rgba(255,255,255,0.8)",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#397cbc",
          },
        },
        //网格线
        splitLine: {
          lineStyle: {
            color: "#11366e",
          },
        },
      },
    ],
    series: [
      {
        name: "脐橙",
        type: "line",
        smooth: true, //是否平滑曲线显示
        showSymbol: false,
        markPoint: {
          data: [
            {
              name: "周最高",
              value: 320,
              xAxis: 4,
              yAxis: 320,
            },
          ],
        },
        itemStyle: {
          color: "#F3A22D",
          borderColor: "#F3A22D",
          borderWidth: 1,
        },
        lineStyle: {
          normal: {
            width: 2,
            color: {
              type: "linear",
              colorStops: [
                {
                  offset: 0,
                  color: "#F3A22D", // 0% 处的颜色
                },
                {
                  offset: 1,
                  color: "#F3A22D", // 100% 处的颜色
                },
              ],
              globalCoord: false, // 缺省为 false
            },
            shadowColor: "#F3A22D",
            shadowBlur: 30,
            shadowOffsetY: 5,
          },
        },
        areaStyle: {
          //区域填充样式
          normal: {
            color: new echarts.graphic.LinearGradient(
              0,
              0,
              0,
              1,
              [
                {
                  offset: 0,
                  color: "rgba(243,162,45, 0.6)",
                },
                {
                  offset: 0.6,
                  color: "rgba(243,162,45, 0.2)",
                },
                {
                  offset: 0.8,
                  color: "rgba(243,162,45, 0.1)",
                },
              ],
              false
            ),
            shadowColor: "rgba(243,162,45, 0.1)",
            shadowBlur: 6,
          },
        },
        data: dataList,
      },
      {
        name: "死亡人数",
        type: "line",
        smooth: true, //是否平滑曲线显示
        showSymbol: false,
        markPoint: {
          data: [
            {
              name: "周最高",
              value: 320,
              xAxis: 4,
              yAxis: 320,
            },
          ],
        },
        itemStyle: {
          color: "#F3A22D",
          borderColor: "#F3A22D",
          borderWidth: 1,
        },
        lineStyle: {
          normal: {
            width: 2,
            color: {
              type: "linear",
              colorStops: [
                {
                  offset: 0,
                  color: "#F3A22D", // 0% 处的颜色
                },
                {
                  offset: 1,
                  color: "#F3A22D", // 100% 处的颜色
                },
              ],
              globalCoord: false, // 缺省为 false
            },
            shadowColor: "#F3A22D",
            shadowBlur: 30,
            shadowOffsetY: 5,
          },
        },
        areaStyle: {
          //区域填充样式
          normal: {
            color: new echarts.graphic.LinearGradient(
              0,
              0,
              0,
              1,
              [
                {
                  offset: 0,
                  color: "rgba(243,162,45, 0.6)",
                },
                {
                  offset: 0.6,
                  color: "rgba(243,162,45, 0.2)",
                },
                {
                  offset: 0.8,
                  color: "rgba(243,162,45, 0.1)",
                },
              ],
              false
            ),
            shadowColor: "rgba(243,162,45, 0.1)",
            shadowBlur: 6,
          },
        },
        data: dataList,
      },
    ],
  };
  return option;
};
export const options6 = () => {
  // let bgColor = "#fff";
  let title = "总量";
  let color = [
    "#c065e7",
    "#765deb",
    "#3862d8",
    "#6a89E2",
    "#219CF9",
    "#6efbbf",
    "#40c057",
    "#ffd351",
    "#ff8e43",
    "#f56b6d",
  ];
  let echartData = [
    {
      name: "A类",
      value: "3720",
    },
    // {
    //   name: "B类",
    //   value: "2920",
    // },
    // {
    //   name: "C类",
    //   value: "2200",
    // },
    // {
    //   name: "D类",
    //   value: "1420",
    // },
    // {
    //   name: "E类",
    //   value: "3200",
    // },
    {
      name: "F类",
      value: "2420",
    },
    {
      name: "G类",
      value: "2200",
    },
    {
      name: "H类",
      value: "1420",
    },
    {
      name: "I类",
      value: "3200",
    },
    {
      name: "J类",
      value: "2420",
    },
  ];

  let formatNumber = function (num) {
    let reg = /(?=(\B)(\d{3})+$)/g;
    return num.toString().replace(reg, ",");
  };
  let total = echartData.reduce((a, b) => {
    return a + b.value * 1;
  }, 0);

  const option = {
    // backgroundColor: bgColor,
    color: color,
    tooltip: {
      trigger: "item",
    },
    // title: [
    //   {
    //     text: "{name|" + title + "}\n{val|" + formatNumber(total) + "}",
    //     top: "center",
    //     left: "center",
    //     textStyle: {
    //       rich: {
    //         name: {
    //           fontSize: 14,
    //           fontWeight: "normal",
    //           color: "#fff",
    //           padding: [10, 0],
    //         },
    //         val: {
    //           fontSize: 32,
    //           fontWeight: "bolder",
    //           color: "#fff",
    //         },
    //       },
    //     },
    //   },
    //   {
    //     text: "单位：个",
    //     top: 20,
    //     left: 20,
    //     textStyle: {
    //       fontSize: 14,
    //       color: "#666666",
    //       fontWeight: 400,
    //     },
    //     show: false,
    //   },
    // ],
    series: [
      {
        type: "pie",
        roseType: "radius",
        radius: ["25%", "70%"],
        center: ["50%", "50%"],
        data: echartData,
        hoverAnimation: false,

        labelLine: {
          normal: {
            length: 45,
            length2: 5,
            lineStyle: {
              // color: '#e6e6e6'
            },
          },
        },
        label: {
          normal: {
            formatter: (params) => {
              return (
                "{icon|●}{name|" +
                params.name +
                "}\n{value|" +
                formatNumber(params.value) +
                "}"
              );
            },
            // padding: [0 , -100, 25, -100],
            rich: {
              icon: {
                fontSize: 16,
                color: "inherit",
              },
              name: {
                fontSize: 18,
                padding: [0, 0, 0, 10],
                color: "#fff",
              },
              value: {
                fontSize: 14,
                fontWeight: "bolder",
                padding: [10, 0, 0, 20],
                color: "inherit",
                // color: '#333333'
              },
            },
          },
        },
      },
    ],
  };
  return option;
};
export const options7 = () => {
  echarts.registerMap("world", world);
  var mapData = [
    //东道主
    ["Russia", "俄罗斯", "yellow"],
    //欧洲区
    ["Germany", "德国", "#afb4db"],
    ["France", "法国", "#b7ba6b"],
    ["Spain", "西班牙", "#905a3d"],
    ["Portugal", "葡萄牙", "#f05b72"],
    ["Belgium", "比利时", "#f15b6c"],
    ["United Kingdom", "英格兰", "#5c7a29"],
    ["Iceland", "冰岛", "#b2d235"],
    ["Croatia", "克罗地亚", "#deab8a"],
    ["Switzerland", "瑞士", "#f05b72"],
    ["Sweden", "瑞典", "#fab27b"],
    ["Denmark", "丹麦", "#d71345"],
    ["Serbia", "塞尔维亚", "#694d9f"],
    ["Poland", "波兰", "#b3424a"],
    //亚洲区
    ["Korea", "韩国", "#f8aba6"],
    ["Japan", "日本", "#ca8687"],
    ["Iran", "伊朗", "#b2d235"],
    ["Saudi Arabia", "沙特阿拉伯", "#5c7a29"],
    ["Australia", "澳大利亚", "#bed742"],
    //南美区
    ["Brazil", "巴西", "#ffd400"],
    ["Argentina", "阿根廷", "#ffce7b"],
    ["Uruguay", "乌拉圭", "#df9464"],
    ["Colombia", "哥伦比亚", "#dea32c"],
    ["Peru", "秘鲁", "#aa2116"],
    //非洲区
    ["Egypt", "埃及", "#840228"],
    ["Tunisia", "突尼斯", "#ed1941"],
    ["Nigeria", "尼日利亚", "#007947"],
    ["Morocco", "摩洛哥", "#73b9a2"],
    ["Senegal", "塞内加尔", "#fcaf17"],
    //中北美加勒比海地区
    ["Costa Rica", "哥斯达黎加", "#f3704b"],
    ["Mexico", "墨西哥", "#8552a1"],
    ["Panama", "巴拿马", "red"],
  ];
  var countrys = function (country, color, name) {
    return {
      name: country,
      value: name,
      itemStyle: {
        borderColor: "#918597",
        areaColor: color,
      },

      label: {
        // show: true,
        formatter: function (params) {
          return params.data.value;
        },
        color: "#f5f5f5",
        fontSize: 10,
      },
      emphasis: {
        itemStyle: {
          areaColor: "yellow",
        },
        label: {
          show: true,
          color: "#fff",
        },
      },
    };
  };
  var countryData = [];
  for (var i = 0; i < mapData.length; i++) {
    countryData.push(countrys(mapData[i][0], mapData[i][2], mapData[i][1]));
  }

  const option = {
    legend: {
      show: true,
    },
    tooltip: {
      show: true,
      formatter: function (params) {
        return params.data.name;
      },
      borderWidth: 1,
      borderColor: "#fff",
      alwaysShowContent: true,
      triggerOn: "none",
    },

    series: [
      {
        type: "map",
        mapType: "world",
        itemStyle: {
          areaColor: "#f5b977",
        },
        emphasis: {
          itemStyle: {
            areaColor: "skyblue",
          },
        },
        data: countryData,
      },
    ],
  };
  // var n = 0;
  // setInterval(function () {
  //   myChart.dispatchAction({
  //     type: "showTip",
  //     seriesIndex: 0,
  //     name: mapData[n][0],
  //   });
  //   myChart.dispatchAction({
  //     type: "mapToggleSelect",
  //     seriesIndex: 0,
  //     name: mapData[n][0],
  //   });
  //   n++;
  //   if (n == mapData.length) {
  //     n = 0;
  //   }
  // }, 1500);
  return option;
};
